package threadLearn;
 class Sum{
    int a=0;
    public void sum(){
        Thread thread =new Thread(()->{
            for (int i = 0; i < 10; i++) {
                System.out.println(a++);
            }
        });
        thread.start();

    }
}
public class demon7 {

    public static void main(String[] args) {
        Sum sum1=new Sum();
        Thread thread=new Thread(()->{
            sum1.sum();
        });
        thread.start();
    }

}
